<template>
  <msg title="权限不足" icon="warn" description="访问的页面没有权限，请联系管理员">
    <template slot="buttons">
      <x-button type="primary" action-type="button" @click="submitOK">确定</x-button>
      <x-button @click="submitOK">取消</x-button>
    </template>
  </msg>
</template>

<script>
import { Msg, Divider, XButton } from "vux";
import { mapState } from "vuex";
export default {
  components: {
    Msg,
    Divider,
    XButton
  },
  methods: {
    submitOK() {
      window.history.go(-1);
    }
  },
  created() {
    this.$store.commit("updateTitle", "权限不足");
    this.$store.commit("updateShowBack", false);
  },
  computed: {
    ...mapState({
      //menus: state => state.menus
    })
  },
  mounted() {
    console.log(this.$store.state.showBack);
    if (!this.$store.state.showBack) {
      this.$parent.$children[0].$vnode.elm.childNodes[2].style.cssText =
        "margin-left:15px!important";
    } else {
      this.$parent.$children[0].$vnode.elm.childNodes[2].style.cssText = "";
    }
  }
};
</script>

<style>
</style>
